on runTests silentSw
  if (not silentSw) then put RETURN&"start unit-test"
  test = false
  errors = 0
  repeat with h in (script "LingoF-UnitTests").handlers()
    if test then
      res = call(h,script "LingoF-UnitTests")
      if (res[1] = res [2] ) then
        if (not silentSw) then
          put "test : " & string(h) & " --> OK "
        end if
      else
        put "test : " & string(h) & " --> FAILED !!! "
        errors = errors + 1
      end if
    end if
    if h = #startTesting then test = true
  end repeat
  
  if not silentSw then put "end testing. Errors : "&string(errors)
end 

on TestMovieFunctionSum
  acc = 0
  repeat with i = 1 to the paramcount
    acc = acc + param(i)
  end repeat
  return acc
end

on stresstest x
  t = the ticks
  repeat with i =1 to x
    runtests(true)
  end repeat
  return the ticks-t
end